package sg.edu.nus.comp.icreate.ivletalk.announcement;

import sg.edu.nus.comp.icreate.ivletalk.ModuleNoRefreshBaseActivity;
import sg.edu.nus.comp.icreate.ivletalk.R;
import android.content.Intent;
import android.os.Bundle;
import android.webkit.WebView;
import android.widget.TextView;

public class ViewAnnouncementContentActivity extends ModuleNoRefreshBaseActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_view_announcement_content);
		Intent intent = getIntent();

		String title = intent.getStringExtra(ListAnnouncementActivity.EXTRA_TITLE);
		String creator = intent.getStringExtra(ListAnnouncementActivity.EXTRA_CREATOR);
		String content = intent.getStringExtra(ListAnnouncementActivity.EXTRA_CONTENT);
		setTitle(title);
		TextView titleView = (TextView) findViewById(R.id.announcementTitleView);
		titleView.setText(title + "\n");
		TextView creatorView = (TextView) findViewById(R.id.announcementCreatorView);
		creatorView.setText(creator + "\n");
		WebView contentView = (WebView) findViewById(R.id.announcementContentView);
		contentView.loadData(content, "text/html", null);
	}
}
